package com.example.mapper;

import com.example.model.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import java.util.List;

@Mapper
public interface UserMapper {
    //添加用户
    public int addUser(User user);

    //7.11 根据id查询用户
    public User getUserById(int id);

    //根据名字和密码查询用户
    public  User getUserByNameAndPassword(@Param("name")String username, String password);

    public List<User> getAll();

    public int delById(int id);

    public int upUser(int id, String username);

    public List<User> getList(String ord);

    public List<User> getListByName(String username);

    public List<User> getListByName2(String username);

    //一对多：获取用户的文章
    public User getFullUser (int id);



}
